import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/layout",
      name: "layout",
      component: () => import("../views/layoutView/LayOutView.vue"),
      children: [
        {
          path: "/iteration",
          name: "iteration",
          component: () => import("../views/iterationView/IterationView.vue"),
        },
        {
          path: "/project",
          name: "project",
          component: () => import("../views/projectView/ProjectView.vue"),
        },
        {
          path: "/user/center",
          name: "userCenter",
          children: [
            {
              path: "/user/center/info",
              name: "userInfo",
              component: () => import("../views/userManger/UserInfoView.vue"),
            },
            {
              path: "/user/center/password",
              name: "userPassrod",
              component: () => import("../views/userManger/UserMangerView.vue"),
            },
            {
              path: "/user/center/modifyUserInfo",
              name: "userMoidyfy",
              component: () =>
                import("../views/userManger/UserModifyInfoView.vue"),
            },
            {
              path: "/user/center/user/list",
              name: "userList",
              component: () => import("../views/userManger/UserListView.vue"),
            },
          ],
        },
        {
          path: "/task",
          name: "task",
          component: () => import("../views/taskView/TaskView.vue"),
        },
        {
          path: "/case",
          name: "case",
          component: () => import("../views/caseView/CaseView.vue"),
        },
      ],
    },
    {
      path: "/login",
      name: "login",
      component: () => import("../views/LoginView.vue"),
    },
    {
      path: "/",
      name: "home",
      component: () => import("../views/HomePage.vue"),
    },
  ],
});

export default router;
